package com.wondream.jenkins.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class JenkinsEventPublisher {

    @Autowired
    private ApplicationEventPublisher publisher;


    public void publish(String eventType, Object data, Map<String, Object> dataMap) {
        JenkinsEvent event = new JenkinsEvent(this, eventType, data, dataMap);
        publisher.publishEvent(event);
    }
}